﻿using Avalon.Core.Data;
using Avalon.Core.MVC.Attributes;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Avalon.Business.ViewModels
{
    [ViewModel(typeof(Data.Models.Character))]
    [DisplayName("Character")]
    public class VMCharacter : IViewModel
    {
        [Order(0)]
        [RenderMode(Core.MVC.Attributes.RenderMode.None)]
        public Guid Id { get; set; }

        [Order(1)]
        [Group("Character Details")]
        [Required]
        [Display(Name = "Naam")]
        [FieldTypeAttribute(Core.Data.FieldType.Text)]
        [DetailNavigationAttribute("Id")]
        public string Name { get; set; }

        [Order(2)]
        [DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
        public string Description { get; set; }
    }

    public class VMCharacter_ListItem : VMCharacter { }

    public class VMCharacter_DetailItem : VMCharacter {
        [Order(10)]
        [RenderType(Core.MVC.Attributes.ViewType.GridView, AllowAdd = true)]
        public ICollection<VMCharacterSkill_GridItem> Skills { get; set; }

        [Order(10)]
        [RenderType(Core.MVC.Attributes.ViewType.GridView)]
        public ICollection<VMCharacterSpecial_GridItem> Specials { get; set; }

        [Order(10)]
        [RenderType(Core.MVC.Attributes.ViewType.GridView)]
        public ICollection<VMCharacterSkill_GridItem> Statistics { get; set; }

        [Order(10)]
        [RenderType(Core.MVC.Attributes.ViewType.GridView)]
        public ICollection<VMCharacterSkill_GridItem> Equipment { get; set; }
    }
}
